﻿using System;
using System.Text;

namespace MailQ.API
{
	public class MailQException : Exception
	{
		public string GetError()
		{
			StringBuilder Sb = new StringBuilder(0);
			Sb.Append(string.IsNullOrEmpty(Message) ? string.Empty : Message);
			Sb.Append(" -- ");
			Sb.Append(StackTrace ?? string.Empty);
			if (InnerException != null)
			{
				Sb.Append(" -- ");
				Sb.Append(string.IsNullOrEmpty(InnerException.Message) ? string.Empty : InnerException.Message);
				Sb.Append(" -- ");
				Sb.Append(InnerException.StackTrace ?? string.Empty);
			}
			return Sb.ToString();
		}
	}
}
